package ipebg.mzk.provider.system.dao;

import ipebg.mzk.common.core.dao.impl.DBDao;
import ipebg.mzk.facade.entity.TokenEntity;

import org.springframework.stereotype.Repository;

/**
 * Created by LT on 2016/4/18.
 */
@Repository("tokenDao")
public class TokenDao extends DBDao<TokenEntity> {
    public TokenDao(){
        super(TokenEntity.class);
    }

    public TokenEntity findToken(String empNo,String token) {
        String sql = "from TokenEntity t where t.empNo=? and t.tokenId=? and t.enable=1 and t.validDt>=sysdate";
        return (TokenEntity) findUnique(TokenEntity.class,sql, new Object[]{empNo, token});
    }
}
